<?php session_start();?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Triumph - Add New Employee</title>
        <link href="maintenancePagesCSS.css" REL="StyleSheet" TYPE="text/css" >
    </head>
    <body>
        <center>
          <table width="1000" height="703" border="0" background="images/background.jpg">
              <tr>
                <th height="340" scope="col"><p><img src="images/TitleDeleteEmployeeRecord.gif" alt="Delete Employee Record"></p>
                  <p>
                    <?php
                include "Employee.php";
                include "EmployeeDAO.php";
                include "Datasource.php";
                $objEmployee = new Employee();
                $objEmployee->setEmpID($_POST['PK']);
                $objDatasouce = new Datasource("localhost", "theanykey", "root", "");
                $objEmpDAO = new EmployeeDao();
                $name = $_POST['lastname'] . ", " . $_POST['firstname'];
                $userID = $_POST['loginid'];
                if($objEmpDAO->delete($objDatasouce, $objEmployee))
                {
                    //successful logical delete!!!
					print("<CENTER><U>You Have Successfully Deleted</U></CENTER><BR>");
                    print(" <table class='SelectTable'><font style='color: WHITE'>
                            <TR><TD>Name:</TD><TD> $name </TD></TR>
                            <TR><TD>ID: </TD><TD> $userID</TD></TR>
							</table>
                            </font>");
                }
                else
                {

                    //no such luck
                    print("<font style='color: red'>
                            Error Deleting the user, please try again.
                            </font>");
                }
            ?>
                    <BR>
                            <font style="font-size: smaller; font-style: italic ">Records containing this userID will still retrieve<BR>
                            this ID's Information, but this user will not be allowed to log in.</font>
                    
                    <BR>
                    <BR>
                            <script src="links.js" language="javascript" type="text/javascript"></script>
                            <script type="text/javascript">
                writeEmployeeLinks("", "");
                          </script>
                  </p></th>
              </tr>
              <tr>
                <th height="357" scope="col">&nbsp;</th>
              </tr>
            </table>

        </center>
    </body>
</html>
